import servers.Synchro_Serv_Impl;
import servers.Time_Out;


/**
 * Traiment d'une tentative de synchronisation
 * @author 2760587
 *
 */

public class Processing extends Thread {

	Time_Out time_out;
	
	public Processing(long Processing_time_out){
		this.time_out = new Time_Out(Processing_time_out);
	}
	public void run(){
		 
		this.time_out.start();
		 
		 
		while (true ){
			System.out.println(" je surveille les nombres d'arrive \n"+Synchro_Serv_Impl.arrives+" "+Synchro_Serv_Impl.nb_in);
			if(Synchro_Serv_Impl.arrives == Synchro_Serv_Impl.nb_in){
				
				 
				synchronized(Synchro_Serv_Impl.objet_notification){
					Synchro_Serv_Impl.synchro_atteinte = true;
					Synchro_Serv_Impl.objet_notification.notifyAll();
					System.out.println("je notifie sur arrives  \n");
				}
			   
			   break;
			}
		
			
		}
		  System.out.println("surveillance  finiched ----------------------------- \n");
		
	}
}
